home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1985 December
/
1985-12.d64
/
variable saver
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
3KB
|
80 lines
100 rem"[255][255][255][255][255][255][255][255] dummy line for saved pointers.
110 [143] ***********************************
120 [143] ** home budget planning aid **
130 [143] ***********************************
140 [143] ***** if [255] still there, no variable pool pointers saved *****
150 [139][194]([194](43)[170][194](44)[172]256[170]7)[178]255[137]230
160 [143] ***** restore variable pool pointers *****
170 [151]45,[194]([194](43)[170][194](44)[172]256[170]6)
180 [151]46,[194]([194](43)[170][194](44)[172]256[170]7)
190 ps[178][194](43)[170][194](44)[172]256:[129]x[178]0[164]5
200 [151] 47[170]x,[194](ps[170]8[170]x):[130]
210 [151]55,[194](45):[151]56,[194](46)[170]4:[137]250: [143] faster save/load
220 [143] ***** perform first time initialization *****
230 [137]580
240 [143] ***** calculate and display *****
250 [153]cs$;:used[178]0:[129]i[178]0[164]ds
260 pc[178](amt(i)[173]amt(0)[170].005)[172]100
270 i$[178][201]([196](i)[170]" ",3)
280 a$[178][201](" "[170][196](amt(i)),5)
290 pc$[178][201](" "[170][196]([181](pc)),3)
300 [153]i$;[200](item$(i)[170]fs$,fs);a$;
310 [139]i[177]0[167][153]pc$"%";:used[178]used[170]amt(i)
320 [153]:[130]
330 [153]"budgeted ="used;bs$;[181]((used[173]amt(0))[172]100);bs$"%"
340 left[178]amt(0)[171]used:[153]"remaining="left;bs$;[181]((left[173]amt(0))[172]100);bs$"%"
350 [143] ***** prompt for user changes *****
360 [153]rv$" chg "ro$"i"rv$"tem, "ro$"a"rv$"mt, "ro$"n"rv$"one?"ro$
370 [161]b$
380 [139]b$[178]"n" [137]470
390 [139]b$[178]"a" [137]420
400 [139]b$[178]"i" [137]440
410 [137]370
420 [153]"item #"rv$","ro$"actual amt":[133]z,a:[139]z[177]ds[167]420
430 amt(z)[178]a:[137]250
440 [153]"item #"rv$","ro$"item desc.":[133]z,z$:[139]z[177]ds[167]440
450 item$(z)[178][200](z$[170]fs$,fs):[137]250
460 [143] ***** prompt for save variables *****
470 [153]cu$rv$" save data+pgm y/n? "
480 [161]x$:[139]x$[178]"n"[167][153]cu$rv$"sys"[196](sr)" or goto100 to run.";:[128]
490 [139]x$[179][177]"y"[167]480
500 [143] ***** save variable pool pointers *****
510 [153]cs$"ready for save of program and variables to tape or disk."
520 [153]"after save, enter 'sys"sr"', or 'goto 100'."
530 ps[178][194](43)[170][194](44)[172]256:[129]x[178]0[164]7
540 [151] ps[170]6[170]x,[194](45[170]x):[130]
550 [151]45,[194](55):[151]46,[194](56)
560 [128]
570 [143] ***** first time variable initialization *****
580 [151]55,[194](45):[151]56,[194](46)[170]4:[156]: [143] faster save/load
590 [143] 256*4=1024 variable pool size
600 [143] *vic* sr=64802:ds=17:cs$=chr$(147):fs=9:fs$="........."
610 sr[178]64738:ds[178]19:cs$[178][199](147):fs[178]27:fs$[178]"..........................."
620 [153]cs$" ?net monthly income?"
630 [134]amt(ds),item$(ds)
640 [133] amt(0)
650 item$(0)[178]"*income* ":amt(0)[178][181](amt(0))
660 item$(1)[178]"housing ":amt(1)[178]850
670 item$(2)[178]"groceries":amt(2)[178]100
680 item$(3)[178]"gas/elec.":amt(3)[178]53
690 item$(4)[178]"telephone":amt(4)[178]14
700 item$(5)[178]"loan #1 ":amt(5)[178]155
710 item$(6)[178]"loan #2 ":amt(6)[178]145
720 item$(7)[178]"gasoline ":amt(7)[178]20
730 item$(8)[178]"insurance":amt(8)[178]43
740 item$(9)[178]"car maint":amt(9)[178]12
750 item$(10)[178]"mc / visa":amt(10)[178]70
760 item$(11)[178]"donations":amt(11)[178]10
770 item$(12)[178]"clothing ":amt(12)[178]25
780 item$(13)[178]"education":amt(13)[178]83
790 item$(14)[178]"home repr":amt(14)[178]80
800 item$(15)[178]"recreat'n":amt(15)[178]60
810 item$(16)[178]"savings ":amt(16)[178]100
820 item$(17)[178]"other ":amt(17)[178]45
830 [143] *vic* leave out item 18 and 19
840 item$(18)[178]"other1 ":amt(18)[178]23
850 item$(19)[178]"other2 ":amt(19)[178]17
860 bs$[178][199](157):cu$[178][199](145):rv$[178][199](18):ro$[178][199](146)
870 [137]250
0